home *** CD-ROM | disk | FTP | other *** search
/ Pascal Super Library / Pascal Super Library (CW International)(1997).bin / TURB_VIS / TVLIST / TVLIST.DOC < prev    next >
Text File  |  1991-03-17  |  35KB  |  1,057 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.             C         H         A         P         T         E        R
  9.             ------------------------------------------------------------
  10.  
  11.  
  12.                                                  TVList Object Reference
  13.  
  14.                              This chapter contains a listing of all the
  15.                              classes, procedures, and types included in
  16.                              the TVList Unit.
  17.  
  18.  
  19.             TList            Abstract Class                       TVList
  20.             ------------------------------------------------------------
  21.  
  22.  
  23.                              TObject -> TCollection -> TList
  24.  
  25.                              TList is an abstract Class that extends the
  26.                              functionality of the TCollection Class.  It
  27.                              can be used to implment Lists or
  28.                              Collections of TObject objects or
  29.                              descendant objects.  It provides a
  30.                              structure for implementing TObjects with
  31.                              any data structure, and yet use these with
  32.                              TListBoxer, TListDialog, and
  33.                              TListDialogInputField objects.  It is also
  34.                              extended to provide simple editing adding,
  35.                              and deleting of list items.
  36.                              See also: TCollection
  37.  
  38.                     Methods  -------------------------------------------
  39.  
  40.  
  41.                  CreateItem  function CreateItem(Corner:Tpoint):pointer;
  42.                              virtual;
  43.  
  44.              Override:Often  Used to create List items to be inserted
  45.                              into TList.  Can be done with user defined
  46.                              dialog box or any other means.  Returns a
  47.                              nil pointer if no item was created.  Need
  48.                              no be redefined for each descendant class.
  49.                              Deafault will simply return a nil pointer.
  50.                              Only needs to be defined if the Add option
  51.                              will be used with TListDialog.  Corner will
  52.                              be passed by TListDialog in Absolute
  53.                              coordinates.  This is the requested
  54.                              location for any TDialog used.  User must
  55.                              determine if a dialog can be located at
  56.                              Corner.  The procedure MakeTrect() can be
  57.                              used for this purpose.
  58.  
  59.                              See Also: MakeTrect(), TPointAssign()
  60.  
  61.  
  62.  
  63.  
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.  
  71.             TVList                                                   2
  72.  
  73.  
  74.                    EditItem  procedure EditItem(Corner:TPoint;
  75.                              Item:pointer); virtual;
  76.  
  77.              Override:Often  Used to edit List items.  Item is a pointer
  78.                              to a List item, a PObject or descendant
  79.                              type.  Editing can be with a dialog or
  80.                              someother means.    Corner will be passed
  81.                              by TListDialog in Absolute coordinates.
  82.                              This is the requested location for any
  83.                              TDialog used.  User must determine if a
  84.                              dialog can be located at Corner.  The
  85.                              procedure MakeTrect() can be used for this
  86.                              purpose.
  87.  
  88.                              See also: MakeRect(), TPointAssign()
  89.  
  90.                 GetItemText  function GetItemText(Item:pointer;
  91.                              MaxLen:integer):string; virtual;
  92.  
  93.             Override:Always  This returns a string that will be used to
  94.                              display a List item's data in a ListBoxer
  95.                              object.  Item is a pointer to the List
  96.                              item, ussually a PObject or descendant
  97.                              object.  The string returned should be
  98.                              MaxLen or less in length.  Must be
  99.                              redefined for each new Class.  Uses the
  100.                              abstract method to halt the program if not
  101.                              redefined.
  102.  
  103.                              See also: Abstract, TListBoxer.GetText,
  104.                              TListBox.GetText
  105.  
  106.                AtAddNewItem  function AtAddNewItem(Corner:TPoint;
  107.                              Index:integer):pointer;
  108.  
  109.              Override:Never  Adds a List item to the TList at the Index
  110.                              location.  Calls
  111.                              AtInsert(Index,CreateItem(Corner)).  Use
  112.                              EndOf Collection to add to the end of the
  113.                              List and 0 to add to the beginning of the
  114.                              list.  Called by TlistDialog.
  115.  
  116.                              See also: TListDialog
  117.  
  118.               MaxTextLength  function MaxTextLength:word;
  119.  
  120.              Override:Never  Returns the length of the longest
  121.                              GetItemText() in the List.  Uses ForEach().
  122.                              Used to determine how wide a ListBox will
  123.                              have to be, so TListDialog can dynamically
  124.                              allocate a dialog size.
  125.  
  126.  
  127.  
  128.  
  129.  
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136.  
  137.             TVList                                                   3
  138.  
  139.  
  140.  
  141.             TSortedList      Abstract Class                       TVList
  142.             ------------------------------------------------------------
  143.  
  144.                              TObject -> TSortedCollection -> TSortedList
  145.  
  146.                              TSortedList is an abstract Class that
  147.                              extends the functionality of the
  148.                              TSortedCollection Class.  It can be used to
  149.                              implment Lists or Collections of TObject
  150.                              objects or descendant objects.  It provides
  151.                              a structure for implementing TObjects with
  152.                              any data structure, and yet use these with
  153.                              TSortedListBoxer, TSortedListDialog, and
  154.                              TListDialogInputField objects.  It is also
  155.                              extended to provide simple editing adding,
  156.                              and deleting of list items.  It will insert
  157.                              items in the list in a sorted fashion.  In
  158.                              addition to the methods below, the KeyOf()
  159.                              and Compare() methods must also be defined.
  160.                              See also: TSortedCollection
  161.  
  162.                     Methods  -------------------------------------------
  163.  
  164.  
  165.                  CreateItem  function CreateItem(Corner:Tpoint):pointer;
  166.                              virtual;
  167.  
  168.              Override:Often  Used to create List items to be inserted
  169.                              into TSortedList.  Can be done with user
  170.                              defined dialog box or any other means.
  171.                              Returns a nil pointer if no item was
  172.                              created.  Need not be redefined for each
  173.                              descendant class.  Deafault will simply
  174.                              return a nil pointer.  Only needs to be
  175.                              defined if the Add option will be used with
  176.                              TListDialog.  Corner will be passed by
  177.                              TSortedListDialog in Absolute coordinates.
  178.                              This is the requested location for any
  179.                              TDialog used.  User must determine if a
  180.                              dialog can be located at Corner.  The
  181.                              procedure MakeTrect() can be used for this
  182.                              purpose.
  183.  
  184.                              See Also: MakeTrect(), TPointAssign()
  185.  
  186.                    EditItem  procedure EditItem(Corner:TPoint;
  187.                              Item:pointer); virtual;
  188.  
  189.              Override:Often  Used to edit List items.  Item is a pointer
  190.                              to a List item, a PObject or descendant
  191.                              type.  Editing can be with a dialog or
  192.                              someother means.    Corner will be passed
  193.                              by TSortedListDialog in Absolute
  194.  
  195.  
  196.  
  197.  
  198.  
  199.  
  200.  
  201.  
  202.  
  203.             TVList                                                   4
  204.  
  205.  
  206.                              coordinates.  This is the requested
  207.                              location for any TDialog used.  User must
  208.                              determine if a dialog can be located at
  209.                              Corner.  The procedure MakeTrect() can be
  210.                              used for this purpose.
  211.  
  212.                              See also: MakeRect(), TPointAssign()
  213.  
  214.                 GetItemText  function GetItemText(Item:pointer;
  215.                              MaxLen:integer):string; virtual;
  216.  
  217.             Override:Always  This returns a string that will be used to
  218.                              display a List item's data in a ListBoxer
  219.                              object.  Item is a pointer to the List
  220.                              item, ussually a PObject or descendant
  221.                              object.  The string returned should be
  222.                              MaxLen or less in length.  Must be
  223.                              redefined for each new Class.  Uses the
  224.                              abstract method to halt the program if not
  225.                              redefined.
  226.  
  227.                              See also: Abstract, TListBoxer.GetText,
  228.                              TListBox.GetText
  229.  
  230.                AtAddNewItem  function
  231.                              AtAddNewItem(Corner:TPoint):pointer;
  232.  
  233.              Override:Never  Adds a List item to the TList at the Index
  234.                              location.  Will place it in the List in
  235.                              sorted position.  Calls
  236.                              Insert(CreateItem(Corner)).    Called by
  237.                              TSortedListDialog.
  238.  
  239.                              See also: TSortedListDialog,
  240.                              TSortedCollection.KeyOf,
  241.                              TSortedCollection.Compare.
  242.  
  243.               MaxTextLength  function MaxTextLength:word;
  244.  
  245.              Override:Never  Returns the length of the longest
  246.                              GetItemText() in the List.  Uses ForEach().
  247.                              Used to determine how wide a ListBox will
  248.                              have to be, so TSortedListDialog can
  249.                              dynamically allocate a dialog size.
  250.  
  251.  
  252.  
  253.  
  254.  
  255.  
  256.  
  257.  
  258.  
  259.  
  260.  
  261.  
  262.  
  263.  
  264.  
  265.  
  266.  
  267.  
  268.  
  269.             TVList                                                   5
  270.  
  271.  
  272.  
  273.             TListBoxer       Class                                TVList
  274.             ------------------------------------------------------------
  275.  
  276.                              TObject -> TView -> TListViewer -> TListBox
  277.                              -> TListBoxer
  278.  
  279.                              TListBoxer is a simple descendant of
  280.                              TListBox.  It primarily wraps
  281.                              TlistBox.GetText around a call to
  282.                              TList.GetItemText.  It also passes control
  283.                              to its owner when the enter key or a double
  284.                              mouse click is used to select an item.
  285.  
  286.                     Methods  -------------------------------------------
  287.  
  288.  
  289.                     GetText  function GetText(Item:Integer;
  290.                              MaxLen:integer):string; virtual;
  291.  
  292.             Override:Seldom  Calls
  293.                              PList(List)^.GetItemText(List^.At(Item),Max
  294.                              Len);
  295.  
  296.                              See also: TListBox.GetText
  297.  
  298.             HandleEvent      procedure HandleEvent(var Event:TEvent);
  299.                              virtual;
  300.  
  301.             Override:Seldom  Traps Enter key and cmListItemSelected
  302.                              before calling TListBox.HandleEvent.
  303.  
  304.                              See also: TListBox.HandleEvent
  305.  
  306.  
  307.  
  308.  
  309.  
  310.  
  311.  
  312.  
  313.  
  314.  
  315.  
  316.  
  317.  
  318.  
  319.  
  320.  
  321.  
  322.  
  323.  
  324.  
  325.  
  326.  
  327.  
  328.  
  329.  
  330.  
  331.  
  332.  
  333.  
  334.  
  335.             TVList                                                   6
  336.  
  337.  
  338.  
  339.             TSortedListBoxer Class                                TVList
  340.             ------------------------------------------------------------
  341.  
  342.                              TObject -> TView -> TListViewer -> TListBox
  343.                              -> TListBoxer -> TSortedListBoxer
  344.  
  345.                              TSortedListBoxer is a simple descendant of
  346.                              TListBox.  It primarily wraps
  347.                              TSortedlistBox.GetText around a call to
  348.                              TSortedList.GetItemText.  It also passes
  349.                              control to its owner when the enter key or
  350.                              a double mouse click is used to select an
  351.                              item.
  352.  
  353.  
  354.                     Methods  -------------------------------------------
  355.  
  356.  
  357.                     GetText  function GetText(Item:Integer;
  358.                              MaxLen:integer):string; virtual;
  359.  
  360.             Override:Seldom  Calls
  361.                              PList(List)^.GetItemText(List^.At(Item),Max
  362.                              Len);
  363.  
  364.                              See also: TListBox.GetText
  365.  
  366.  
  367.  
  368.  
  369.  
  370.  
  371.  
  372.  
  373.  
  374.  
  375.  
  376.  
  377.  
  378.  
  379.  
  380.  
  381.  
  382.  
  383.  
  384.  
  385.  
  386.  
  387.  
  388.  
  389.  
  390.  
  391.  
  392.  
  393.  
  394.  
  395.  
  396.  
  397.  
  398.  
  399.  
  400.  
  401.             TVList                                                   7
  402.  
  403.  
  404.  
  405.             TListDialog      Class                                TVList
  406.             ------------------------------------------------------------
  407.  
  408.                              TObject -> TView -> TGroup -> TWindow
  409.                              -> TDialog -> TListDialog
  410.  
  411.                              TListDialog is a highly tuned Dialog to be
  412.                              used with TList objects to display a TList
  413.                              in a ListBox.  It can serve a variety of
  414.                              functions.  It can be used to simply
  415.                              display the items in a Tlist object with a
  416.                              ListBox, it can be used to select items
  417.                              from a Tlist Object with a ListBox, it can
  418.                              be used to edit, add, and or delete items
  419.                              from a TList object using a ListBox.  The
  420.                              intent of this Class is to provide a well
  421.                              supported and flexible user interface for
  422.                              TList objects that requires little
  423.                              redefinition, and can be setup and executed
  424.                              with a minimal amount of code and support.
  425.  
  426.                              TListDialog inserts at a minimum a
  427.                              TListBoxer, an cmOK TButton, and a cmCancel
  428.                              TButton.  Based on the values passed in
  429.                              Behavior with Init, an Add TButton, Edit
  430.                              TButton, and/or Delete TButton are also
  431.                              provided.  The size and location of the
  432.                              TDialog object can be dynamically
  433.                              calculated by Init.
  434.  
  435.                              TlistDialog has the following properties:
  436.  
  437.                              o  Enter key is trapped and used to select
  438.                                 a highlighted item in the listbox when
  439.                                 the listbox is selected or select a
  440.                                 button.
  441.  
  442.                              o  Up and Down Cursor keys can be used to
  443.                                 scroll the List Box or move from Button
  444.                                 to Button in the dialog box.
  445.  
  446.                              o  Esc key or Cancel button generates a
  447.                                 cmCancel evCommand event.  Item Selected
  448.                                 from List Box is not returned, BUT any
  449.                                 items added, edited, or deleted will not
  450.                                 be restored to their state when the
  451.                                 dialog was executed.
  452.  
  453.                              o  Double Click of the mouse in the ListBox
  454.                                 selects the item.
  455.  
  456.                              o  All other default properties of TDialog
  457.                                 objects remain.
  458.  
  459.  
  460.  
  461.  
  462.  
  463.  
  464.  
  465.  
  466.  
  467.             TVList                                                   8
  468.  
  469.  
  470.                              The behavior of the Dialog is controlled by
  471.                              the AB field which can set with the
  472.                              Behavior parameter with in init
  473.                              constructor.  The bits of the AB behavior
  474.                              field are defined as follows:
  475.  
  476.                              msb          lsb
  477.                              [][][][][][][][]    Constants
  478.                                  | | | | | |
  479.                                  | | | | | `---- sfAdd          = $01
  480.                                  | | | | `------ sfDelete       = $02
  481.                                  | | | `-------- sfEdit         = $04
  482.                                  | | `---------- sfSearch       = $08
  483.                                  | `------------ sfPromptDelete = $10
  484.                                  `-------------- SfPromptExit   = $20
  485.  
  486.  
  487.                              Two general purpose constant masks are:
  488.                                  sfFullEdit = sfAdd + sfDelete + sfEdit;
  489.                                  sfDoall  = $FF;
  490.  
  491.                              With sfAdd bit set TListDialogs will insert
  492.                              a ADD button in the dialog.  Slection of
  493.                              this button will call TList.CreateItem.  If
  494.                              this has not be redefined, then nothing
  495.                              happens.
  496.  
  497.                              With sfDelete bit set TListDialogs will
  498.                              insert a DELETE button.  Selection of the
  499.                              button will delete the currently selected
  500.                              item in the list box.
  501.  
  502.                              With sfEdit bit set TListDialogs will
  503.                              insert an EDIT button in the dialog.
  504.                              Selecting this button will call
  505.                              TList.EditItem.  If this is not defined
  506.                              then nothing happens.
  507.  
  508.                              If using a TSortedList with TSortedList
  509.                              (see Below), with the sfSearch bit set the
  510.                              Dialog will allow keystrokes to be used to
  511.                              do an incremental search of the Tlistbox
  512.                              when the listbox is selected.  As each key
  513.                              is pressed the search string is displayed
  514.                              on a search line and the TListbox moves the
  515.                              focus to the item that most closely matches
  516.                              the search string.  Using the backspace key
  517.                              will delete keys from the searchline.
  518.  
  519.                              With the sfPromptDelete bit set, the dialog
  520.                              will promote for approval before a Delete
  521.                              is preformed.
  522.  
  523.  
  524.  
  525.  
  526.  
  527.  
  528.  
  529.  
  530.  
  531.  
  532.  
  533.             TVList                                                   9
  534.  
  535.  
  536.                              With the sfPromptExit bit set, the dialog
  537.                              will move to the OK button on a selection
  538.                              from the List box.  This provides a way to
  539.                              verify a selection before exiting the
  540.                              dialog.  With this bit unset, selecting an
  541.                              item in the list box (with the mouse or
  542.                              pressing enter) exits the dialog.
  543.  
  544.  
  545.                      Fields  -------------------------------------------
  546.  
  547.  
  548.                          AB  AB : byte;                               Read only
  549.  
  550.                              This is used to determine what the behavior
  551.                              of the Dialog will be.  See definition of
  552.                              mask bits above.
  553.  
  554.                              See also: TListDialog.Init
  555.  
  556.                         TLR  TLR:TListRec;                            Read only
  557.  
  558.                              This is used to store the index and pointer
  559.                              of the focused item in ListBox when the
  560.                              dialog is closed after selecting an item
  561.                              from the ListBox.
  562.  
  563.                         Max  Max:byte;                                Read only
  564.  
  565.                              The is the Maximum width of the GetItemText
  566.                              with in the List being used.
  567.  
  568.                        List  List:pointer;                            Read only
  569.  
  570.                              This is a pointer to a Plist object that
  571.                              has been initialized.
  572.  
  573.                          LB  LB:PlistBox;                             Read only
  574.  
  575.                              This is a pointer to the ListBoxer being
  576.                              used to display the List.
  577.  
  578.                         X,Y  X,Y:word;                                Read only
  579.  
  580.                              This is the location of a status line used
  581.                              by the Dialog.  This is used to locate
  582.                              where the ListBox header will be located.
  583.                              This is also used by TSortedListDialog to
  584.                              display the active search string.
  585.  
  586.                SearchString  SearchString:PString;                    Read only
  587.  
  588.                              This is the current string being used to
  589.                              incrementally search through List.
  590.  
  591.  
  592.  
  593.  
  594.  
  595.  
  596.  
  597.  
  598.  
  599.             TVList                                                   10
  600.  
  601.  
  602.  
  603.  
  604.                     Methods  -------------------------------------------
  605.  
  606.  
  607.                        Init  constructor Init(var Bounds:Trect;
  608.                              ATitle:TTitleStr; Behavior:byte;
  609.                              TheList:PList; BoxHeader:TTitleStr);
  610.  
  611.              Override:Never  Bounds is the location and size of the
  612.                              desired dialog box.  This may be resized
  613.                              and reloacted if sufficient room is not
  614.                              provided.  If bounds is assigned with
  615.                              Bounds.assign(X,Y,0,0) then a dialog box is
  616.                              opened with upper left corner at XY and
  617.                              with a listbox of 4 lines and sized to
  618.                              accomodate all behavior buttons.  ATitle
  619.                              will be used for the Dialogs title.
  620.                              Behavior is a set of flags that can be
  621.                              passed to activate certain functions in the
  622.                              Dialog box.  TheList is the list! This is a
  623.                              PLIST class instances that contians a list
  624.                              of data records.  BoxHeader is an optional
  625.                              string that will be used a Tlabel for the
  626.                              ListBox.  This can be useful if the
  627.                              GetItemText() string actually contains data
  628.                              from multiple fields.  BoxHeader can be
  629.                              used to label these fields.
  630.  
  631.                              See also: AB
  632.  
  633.  
  634.                    DataSize  function DataSize: word; virtual;
  635.  
  636.              OverRide:Never  Default is to return sizeof(TListRec).
  637.  
  638.  
  639.                     GetData  procedure GetData(var rec); virtual;
  640.  
  641.              OverRide:Never  Default is to return a pointer to a
  642.                              TListRec data type.  Returns a TListRec
  643.                              datatype where TListRec.item is a pointer
  644.                              to the selected object in the List, if the
  645.                              Dialog concluded with a cmOk command.
  646.                              Returns a nil pointer in TListRec.Item
  647.                              otherwise.  TListRec.Index provides the
  648.                              index to the item that was selected.
  649.  
  650.  
  651.                     SetData  procedure SetData(var rec); virtual;
  652.  
  653.              OverRide:Never  Default is to move a TListRec into Rec.
  654.  
  655.  
  656.  
  657.  
  658.  
  659.  
  660.  
  661.  
  662.  
  663.  
  664.  
  665.             TVList                                                   11
  666.  
  667.  
  668.                 HandleEvent  procedure HandleEvent(var Event:TEvent);
  669.                              virtual;
  670.  
  671.             Override:Seldom  Handles interaction between ListBox and
  672.                              Dialog
  673.  
  674.  
  675.  
  676.  
  677.  
  678.  
  679.  
  680.  
  681.  
  682.  
  683.  
  684.  
  685.  
  686.  
  687.  
  688.  
  689.  
  690.  
  691.  
  692.  
  693.  
  694.  
  695.  
  696.  
  697.  
  698.  
  699.  
  700.  
  701.  
  702.  
  703.  
  704.  
  705.  
  706.  
  707.  
  708.  
  709.  
  710.  
  711.  
  712.  
  713.  
  714.  
  715.  
  716.  
  717.  
  718.  
  719.  
  720.  
  721.  
  722.  
  723.  
  724.  
  725.  
  726.  
  727.  
  728.  
  729.  
  730.  
  731.             TVList                                                   12
  732.  
  733.  
  734.  
  735.             TSortedListDialog  Class                              TVList
  736.             ------------------------------------------------------------
  737.  
  738.                              TObject -> TView -> TGroup -> TWindow
  739.                              -> TDialog -> TListDialog
  740.                              -> TSortedListDialog
  741.  
  742.                              Provides same functions of TListDialog, but
  743.                              is used with TSortedList object.
  744.                              TSortedListDialog can provide incremental
  745.                              scrolling of the list box based on a search
  746.                              string.  While the ListBox is active, a
  747.                              string can be entered from the key board.
  748.                              As each key is detected, the ListBox is
  749.                              searched for the closest matching string.
  750.                              When this search feature is active, the
  751.                              spacebar can not be used to select from th
  752.                              ListBox.
  753.  
  754.                     Methods  -------------------------------------------
  755.  
  756.  
  757.                        Init  constructor init(var Bounds:Trect;
  758.                              ATitle:TTitleStr;Behavior:byte;
  759.                              TheList:PSortedList; BoxHeader:TTitleStr);
  760.  
  761.                              Same as PListDialog.init except TheList is
  762.                              a PSortedList class.
  763.  
  764.                              See also: TListDialog.init
  765.  
  766.                 HandleEvent  procedure HandleEvent(var Event:TEvent);
  767.                              virtual;
  768.  
  769.             Override:Seldom  Handles interaction between ListBox and
  770.                              Dialog  similar to TlistDialog, but also
  771.                              provides for an incremental search of
  772.                              ListBox based on a searchstring entered
  773.                              from the keyboard.
  774.  
  775.                              See also: TListDialog.HandleEvent
  776.  
  777.  
  778.  
  779.  
  780.  
  781.  
  782.  
  783.  
  784.  
  785.  
  786.  
  787.  
  788.  
  789.  
  790.  
  791.  
  792.  
  793.  
  794.  
  795.  
  796.  
  797.             TVList                                                   13
  798.  
  799.  
  800.  
  801.             TListDialogInputField  Class
  802.             ------------------------------------------------------------
  803.  
  804.                              TObject -> TView -> TInputLine
  805.                              -> TListDialogInputField
  806.  
  807.                              This class is a descendant of TInputline,
  808.                              however it does no allow entry of data.  It
  809.                              is used to execute a TListDialog or
  810.                              TSortedListDialog from within another
  811.                              dialog.  It is inserted into a dialog just
  812.                              like anyother TInputLine object.  When the
  813.                              dialog is executed this field displays the
  814.                              string value of item at the position set by
  815.                              setdata.  When this field is selected,
  816.                              pressing the Ins key or the right or left
  817.                              arrow keys will execute a Tlist dialog.
  818.                              After this TList dialog is closed, this
  819.                              field will display the item selected in the
  820.                              TList Dialog.  IT provides a convient way
  821.                              to insert ListBoxes in dialogs with out
  822.                              taking up a lot of screen space.
  823.  
  824.  
  825.                      Fields  -------------------------------------------
  826.  
  827.  
  828.                          TD  TD:pointer;                              Read Only
  829.  
  830.                              Pointer to TListDialog
  831.  
  832.                          TL  TL:pointer;                              Read Only
  833.  
  834.                              Pointer to TList
  835.  
  836.                         Max  Max:byte;                                Read Only
  837.  
  838.                              Maximum string value returned by
  839.                              TL^.GetItemText
  840.  
  841.                       Index  Index:word;                              Read Only
  842.  
  843.                              Index of Listbox, Set by SetData
  844.  
  845.                      Sorted  Sorted:boolean;                          Read Only
  846.  
  847.                              Indicates that TL is a TSortedList object
  848.                              pointer.
  849.  
  850.  
  851.  
  852.  
  853.  
  854.  
  855.  
  856.  
  857.  
  858.  
  859.  
  860.  
  861.  
  862.  
  863.             TVList                                                   14
  864.  
  865.  
  866.                     Methods  -------------------------------------------
  867.  
  868.  
  869.                        Init  constructor init (Field:TPoint;
  870.                              ListLocation:Tpoint; ListHeight:word;
  871.                              Title:String; Behavior:byte; AList:Pointer;
  872.                              BoxHeader:string; SortedList:boolean);
  873.  
  874.             Override:Seldom  Field is the left X,Y of the location in
  875.                              the dialog.  ListLocation is the X,Y
  876.                              location relative to the Field location
  877.                              where the TlistDialog should be located.
  878.  
  879.  
  880.                    DataSize  function  DataSize:word; virtual;
  881.  
  882.             Override:Seldom  Default returns a value of 2
  883.  
  884.  
  885.                     GetData  procedure GetData(Var Rec); virtual;
  886.  
  887.             Override:Seldom  Default moves a word size value into Rec
  888.                              from the Index field.
  889.  
  890.  
  891.                     SetData  procedure SetData(Var Rec); virtual;
  892.  
  893.             Override:Seldom  Deafault moves a word size value from Rec
  894.                              into the Index field.
  895.  
  896.  
  897.                 HandleEvent  procedure HandleEvent(var Event:TEvent);
  898.                              virtual;
  899.  
  900.             Override:Seldom  Handles user input.  kbEnter is translated
  901.                              to a kbTab.  kbIns, kbRight, and kbLeft and
  902.                              mouse double click executes the
  903.                              TListDialog.
  904.  
  905.  
  906.  
  907.  
  908.  
  909.  
  910.  
  911.  
  912.  
  913.  
  914.  
  915.  
  916.  
  917.  
  918.  
  919.  
  920.  
  921.  
  922.  
  923.  
  924.  
  925.  
  926.  
  927.  
  928.  
  929.             TVList                                                   15
  930.  
  931.  
  932.  
  933.             RegisterTVList   procedure
  934.             ------------------------------------------------------------
  935.                 Declaration  procedure RegisterTVList;
  936.  
  937.                    Function  Registers TList and TSortedList objects.
  938.                              ObjType codes are TList, 2000 and
  939.                              TSortedList 2001
  940.  
  941.  
  942.                              The IDs used to register TV objects are
  943.                                TList           200
  944.                                TSortedList     201
  945.  
  946.  
  947.  
  948.             MakeRect         procedure
  949.             ------------------------------------------------------------
  950.                 Declaration  procedure  MakeRect(Corner:Tpoint;
  951.                              Xsize,YSize:integer; var Bounds:Trect);
  952.  
  953.                    Function  This procedure takes Corner, which should
  954.                              be in global coordinates, and trys to
  955.                              create a Rectangle with an upper left
  956.                              Corner and is XSize wide and YSize high.
  957.                              If this is not possible, it will try and
  958.                              adjust Corner to a location where such a
  959.                              rectangle can be displayed.  Failing that
  960.                              it will create the Largest Rectangle that
  961.                              can be displayed.
  962.  
  963.  
  964.  
  965.             TPointAssign     procedure
  966.             ------------------------------------------------------------
  967.                 Declaration  Procedure TPointAssign(var P:TPoint;
  968.                              X,Y:integer);
  969.  
  970.                    Function  This procedure simply assigns X,Y to the
  971.                              Tpoint object, easier than P.X := X;
  972.                              P.Y:=Y;
  973.  
  974.  
  975.  
  976.  
  977.             TListRec         type
  978.             ------------------------------------------------------------
  979.  
  980.  
  981.                 Declaration  TListRec = record
  982.  
  983.                                 Item:pointer;
  984.                                 Index:integer;
  985.                                 end;
  986.  
  987.  
  988.  
  989.  
  990.  
  991.  
  992.  
  993.  
  994.  
  995.             TVList                                                   16
  996.  
  997.  
  998.                    Function  Data type used with TListDialog and
  999.                              TSortedListDialog methods GetData and
  1000.                              Setdata.  Item points to the item which was
  1001.                              selected from the dialogs list box on exit.
  1002.                              Index is its index into the list.
  1003.  
  1004.  
  1005.  
  1006.  
  1007.  
  1008.  
  1009.  
  1010.  
  1011.  
  1012.  
  1013.  
  1014.  
  1015.  
  1016.  
  1017.  
  1018.  
  1019.  
  1020.  
  1021.  
  1022.  
  1023.  
  1024.  
  1025.  
  1026.  
  1027.  
  1028.  
  1029.  
  1030.  
  1031.  
  1032.  
  1033.  
  1034.  
  1035.  
  1036.  
  1037.  
  1038.  
  1039.  
  1040.  
  1041.  
  1042.  
  1043.  
  1044.  
  1045.  
  1046.  
  1047.  
  1048.  
  1049.  
  1050.  
  1051.  
  1052.  
  1053.  
  1054.  
  1055.  
  1056.  
  1057.